<template>
  <div class="main">
    <!-- <x-header title="选择被检查单位"></x-header> -->
      <div class="tree-menu">
        <noData v-if="theModel == 0"></noData>
        <ul v-for="(menuItem,index) in theModel" :key="index">
          <my-tree :model="menuItem"></my-tree>
        </ul>
    </div>
    <myMenu @clickBack="back" ></myMenu>
  </div>

</template>

<script>
import myTree from '../treemenu';
import { XHeader,Tabbar, TabbarItem, Group, Cell } from 'vux'
import myMenu from '@/commonComponents/menu'
export default {
  name: 'App',
  data () {
      return {
        theModel:[],
        userId:"",
        tokenId:"",
        projectId:"",
        userInfo:""
      }
 },
  components: {
    Tabbar,
    TabbarItem,
    Group,
    Cell,
    XHeader,
     myTree,
     myMenu
  },
  created() {
    this.userInfo = JSON.parse(localStorage.userInfo)
    this.userId = this.userInfo.userid;
    this.tokenId = this.userInfo.tokenId;
    this.projectId = this.userInfo.deptid;
    this.getCompany();
  },
  methods:{
    back(){

    },
    getCompany(){
      let param = {
        "allowPaging": true,
        "business": "GetHdProjects",
        "data":this.projectId,
        "pageIndex": 0,
        "pageSize": 20,
        "tokenId": this.userId,
        "userId": this.tokenId
        }
      this.$axiosAjax.getConfigJson(
        param
      ).then(
         (res)=>{
            this.theModel = res.data.data;
         }
      )

    },
  }

}
</script>

<style scoped lang="less">
.main{
  padding:0 10px;
  box-sizing: border-box;
}
</style>
